import React, { Component } from 'react'
import {connect} from 'react-redux'
import {createIncrementAction} from '../../redux/actions/count_action'
class Count extends Component {
	add=() =>{
		//jia
		this.props.jia(1)
	}
	render() {
		console.log(this.props.he)
		return (
			
			<div>
				<h2>求和为：{this.props.he},length:{this.props.length}</h2>
				<button onClick={this.add}>jia</button>
			</div>
		)
	}
}

export default connect(
	state=>({he:state.count,
		length:state.person.length
	}),
    {jia:createIncrementAction}
	//映射状态
	//映射操作状态的方法
)(Count)
